﻿using Commons.DomainBase;
using Kogel.Dapper.Extension.Attributes;

namespace FileService.Domain.Entities
{
    [Display(Rename = "videos")]
    public class Videos:IParentId
    {
        [Identity(false)]
        public long Id { set; get; }
        /// <summary>
        ///
        /// </summary>
        public string FileUrl { set; get; } = "";
        /// <summary>
        ///
        /// </summary>
        public string FileName { set; get; } = "";
        /// <summary>
        ///
        /// </summary>
        public string Img { set; get; } = "";
        /// <summary>
        ///
        /// </summary>
        public string StudentName { set; get; }
        /// <summary>
        ///
        /// </summary>
        public long ParentId { set; get; }
        /// <summary>
        ///
        /// </summary>
        public DateTime Time { set; get; }

        public static Videos Create(string name, long tabId)
        {

            Videos item = new()
            {
                Id = IdWorkerHelper.NextId(),
                StudentName = name,
                ParentId = tabId,
                Time = DateTime.Now,
            };
            return item;
        }

        public Videos SetFile(string fileUrl, string fileName,string Img)
        {
            this.FileName = fileName;
            this.Img = Img;
            this.FileUrl = fileUrl;
            return this;
        }
    }
}